<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        /*
        Date js中用于时间和日期的管理对象
        */

        //1.获取日期和时间对象
        var date = new Date();

        //2.使用方法来获取与时间先关的内容
        var str = date.getFullYear() + "年";
        str += date.getMonth() + 1 + "月";
        str += date.getDate() + "日";
        str += date.getHours() + "时";
        str += date.getMinutes() + "分";
        str += date.getSeconds() + "秒";

        console.log(str);






    </script>
</head>

<body>

</body>

</html>